import tkinter as tk
import get_data as gd
import tkinter.font as tf

def insert_top_three_window():
    datas = gd.get_news()
    data_add = datas[3]
    data = datas[2]
    window3 = tk.Toplevel()
    window3.geometry("400x150")
    window3.title("开学建议")
    ft = tf.Font(family = "华文仿宋",size=15)
    t1 = tk.Text(window3,font=ft)
    t1.pack()

    if data == "石景山区14日内有增长":
        t1.insert("end","    不建议开学，因为石景山区14日内有增长。建议学生居家学习。")
       
    elif int(data_add) < 28:
        
        t1.insert("end","    不太建议开学，因为石景山区"+data_add+"天内有增长。WHO建议，连续两个最长潜伏期无增长才可放心。建议学生居家学习。")
    elif int(data_add) >= 28:
       
        t1.insert("end","    可以开学。因为石景山区已经连续"+data_add+"天无增长。WHO建议，连续两个最长潜伏期无增长才可放心。不过开学与北京市的整体情况有关，要视北京市的情况而定。")

    window3.mainloop()
